home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1657 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.6 KB

  1. Path: herold.franken.de!jhd
  2. Date: 11 Jan 1996 08:35:00 +0100
  3. From: jhd@herold.franken.de (Joachim Durchholz)
  4. Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.modula2,comp.lang.modula3,comp.lang.smalltalk
  5. Message-ID: <60dugv4F3RB@herold.franken.de>
  6. References: <cmanDK7x13.5KM@netcom.com> <4cnmqu$2fg@beatty.slip.netcom.com>
  7.     <60SqRiBF3RB@herold.franken.de> <60SqRiBF3RB@herold.franken.de>
  8.     <Pine.HPP.3.91.960110141715.5791A-100000@hot.cs.byu.edu>
  9. Subject: Re: whither style
  10. X-Newsreader: XP v3.02
  11. MIME-Version: 1.0
  12. Content-Type: text/plain; charset=ISO-8859-1
  13. Content-Transfer-Encoding: 8bit
  14.  
  15. cookd@cs.byu.edu wrote 10.01.96 on Re: whither style:
  16.  
  17. > On 8 Jan 1996, Joachim Durchholz wrote:
  18. >
  19. > > I think HN is inappropriate for languages where you can change the
  20. > > representation of a type behind the scenes, simply because it's impossible
  21. > > to invent an abbreviation for every type that shows up in a project.
  22. >
  23. > In a way, you almost have it exactly right here, but it isn't the language
  24. > that is the deciding factor--it is the environment of the language.  When
  25. > you run your programs in an environment where you must pass information
  26. > from one program to another, type checking is not applicable so a
  27. > notation is necessary to remind programmers (especially when they are
  28. > doing low-level stuff as is often necessary when moving data between two
  29. > programs) what type they should be using.
  30.  
  31. Good point.
  32. But still:
  33.  
  34. > When I call the Windows API,
  35. > it is nice to see that the variable name is lpsz.... when the type is a
  36. > generic POINTER that could point to anything.
  37.  
  38. But shouldn't the Windows API prototype be declared with something more  
  39. specific than a POINTER? This sounds more like a problem how careful the  
  40. API designer is. If the predefined APIs aren't specific enough, nobody  
  41. will hinder you to define a more specific interface.
  42.  
  43. > When I save data in a file
  44. > that could be read by an Intel based implementation of Modula II or
  45. > Pascal, a MIPS version of C, or an embedded system running code developed
  46. > in Ada, it is nice to know that they all expect an i16... (or however the
  47. > notation says int16 should be prefixed).
  48.  
  49. This could be handled by taking care that all language-specific parts of  
  50. the API are consistent.
  51.  
  52.  
  53. Of course keeping the interfaces consistent across vastly different  
  54. languages needs a bit of thinking. But I should be able to handle this by  
  55. doing stuff in some simple, easy-to-parse language and can automatically  
  56. translate to other languages, so it's not really an issue.
  57.  
  58. -Joachim
  59.  
  60. --
  61. Im speaking for myself here.
  62. ## CrossPoint v3.02 ##
  63.